package ws.very.util.akka.rtc

import ws.very.util.akka.actor.ReplyAct
import akka.actor.ActorRef
import akka.util.Timeout
import scala.util.Success
import scala.util.Try

trait CodeManager extends ReplyAct{
  import akka.pattern.ask
  implicit def compileTimeOut:Timeout
  def compiler:ActorRef
  def receive={
    case ("reg",codeName:S,code:S,version:L)=>
//      if(canReplace(codeName, code, version))
//        (compiler ? ("eval"->code)).mapTo[Try[A]].onComplete { case t =>
//          null
//      }
  }
  
  def canReplace(codeName:S,code:S,version:L):B
  
  
}